var mongoose =require('mongoose')
var DB_URL='mongodb://localhost:27017/jg_admin'
mongoose.set('useCreateIndex', true) 
mongoose.connect(DB_URL,{ useNewUrlParser: true, useUnifiedTopology: true })

mongoose.connection.on('connected',()=>{
    console.log('<======数据库连接成功=====>')
})
mongoose.connection.on('disconnected',()=>{
    console.log('<======数据库连接失败=====>')
})
mongoose.connection.on('error',()=>{
    console.log('<======数据库连接错误=====>')
})
module.exports=mongoose